import { EggPlugin } from "egg";

console.log(process.env.NODE_ENV);

const plugin: EggPlugin = {
  static: true,
  mysql: {
    // mysql配置
    enable: true,
    package: "egg-mysql"
  },
  sequelize: {
    // 序列化配置
    enable: true,
    package: "egg-sequelize"
  },
  jwt: {
    enable: true,
    package: "egg-jwt"
  }
};

if (process.env.NODE_ENV === "development") {
  plugin.swaggerdoc = {
    enable: true,
    package: "egg-swagger-doc"
  };
}

export default plugin;
